-- 格式要UTF8-BOM
local TWaryLua = require "TWaryLua";

math.randomseed(100)




function getGoogleRandom(n)
    local t1 = {                
        "a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z",
        "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z",        
    }    

    local s = ""
    for i = 1, n do
        s = s .. t1[math.random(#t1)]        
    end;

    return s
end;


function concat_google()
    local google = getGoogleRandom(10)
    local base32 = TWaryLua.Base32Encode(google)
    local xorEncrypt = TWaryLua.XorEncrypt(google)

    return google .. "\n" .. base32 .. "\n" .. xorEncrypt .. "\n\n"
end

local content ="google 验证码生成, 种子100\n"
content = content .. '[a]\n' .. concat_google()   
content = content .. '[b]\n' .. concat_google()
content = content .. '[c]\n' .. concat_google()
content = content .. '[d]\n' .. concat_google()
content = content .. '[e]\n' .. concat_google()
content = content .. '[f]\n' .. concat_google()
content = content .. '[g]\n' .. concat_google()
content = content .. '[h]\n' .. concat_google()
content = content .. '[i]\n' .. concat_google()
content = content .. '[j]\n' .. concat_google()
content = content .. '[k]\n' .. concat_google()
content = content .. '[l]\n' .. concat_google()
content = content .. '[m]\n' .. concat_google()
content = content .. '[n]\n' .. concat_google()
content = content .. '[o]\n' .. concat_google()
content = content .. '[p]\n' .. concat_google()
content = content .. '[q]\n' .. concat_google()
content = content .. '[r]\n' .. concat_google()
content = content .. '[s]\n' .. concat_google()
content = content .. '[t]\n' .. concat_google()
content = content .. '[u]\n' .. concat_google()
content = content .. '[v]\n' .. concat_google()
content = content .. '[w]\n' .. concat_google()
content = content .. '[x]\n' .. concat_google()
content = content .. '[y]\n' .. concat_google()
content = content .. '[z]\n' .. concat_google()

local file = TWaryLua.SaveToFile("./谷歌验证码.txt", content)
